package grp.svcInvkr.ctl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import grp.svcInvkr.svc.BsnsSvc;
import grp.svcInvkr.svc.IvkSvcItfc;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.servlet.ModelAndView;

@RestController
public class MdOpt {
	private final Logger logger = LoggerFactory.getLogger(this.getClass());
	
    @RequestMapping(value = "/connect/{param}", method = RequestMethod.GET)
    public String connect(@PathVariable String param) {
    	logger.info("Simple question and answer");
        return "success : " + param;
    }

    @Autowired
    private IvkSvcItfc svItfc;
    @RequestMapping(value = "/Interact", method = RequestMethod.GET)
    public String Interact(@RequestParam("param") String param) {		// fegin-rpc
    	logger.info("fegin-rpc");
        return svItfc.Interact(param);
    }

    @Autowired
    private BsnsSvc bsnsSvc;
    @RequestMapping(value = "/errFuse", method = RequestMethod.GET)
    public String errFuse() {						// feign-hystrix
    	logger.info("feign-hystrix");
        return bsnsSvc.errFuse();
    }
    @GetMapping(value = "/webShow")
    public ModelAndView tmplt01() {
        return new ModelAndView("webShow");
    }
}
